package com.cqc.mebaidumapdemo.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.baidu.mapapi.map.MapStatus;
import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.model.LatLng;
import com.cqc.mebaidumapdemo.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by ${cqc} on 2017/7/5.
 */

public class BaseMapDemo extends AppCompatActivity {

    @BindView(R.id.mapView)
    MapView mapView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_base_map);
        ButterKnife.bind(this);

//        MapStatus.Builder builder = new MapStatus.Builder();
//        LatLng latLng = new LatLng(121.391968d, 31.243099d);
//        MapStatus mapStatus = builder.target(latLng).zoom(11.0f).overlook(30.0f).rotate(50.0f).build();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //在activity执行onDestroy时执行mMapView.onDestroy()，实现地图生命周期管理
        mapView.onDestroy();
    }

    @Override
    protected void onResume() {
        super.onResume();
        //在activity执行onResume时执行mMapView. onResume ()，实现地图生命周期管理
        mapView.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
        //在activity执行onPause时执行mMapView. onPause ()，实现地图生命周期管理
        mapView.onPause();
    }
}
